<?php

namespace App\Http\Controllers\Api;

use Illuminate\Http\Request;
use App\Services\AliPayService;
use Alipay\EasySDK\Kernel\Config;
use App\Http\Controllers\Controller;

class AliPayController extends Controller
{
    // 发起支付
    public function createPay(Request $request)
    {
        $notifyUrl = config("app.url") . '/alipay/recharge';
        $quitUrl = config("app.url") . '/account/recharge';
        $returnUrl = config("app.url") . '/account/index';
        $result = AliPayService::h5Pay('','','',$notifyUrl,$quitUrl,$returnUrl);
        return $this->resJson(200,'成功');
    }
}
